<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['运输任务','轨迹修复审核']" icon="fa fa-truck" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>轨迹修复审核</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 230px);">
                                <div class="top_module">
									<span class="module_text">车牌号码</span>
									<div class="s_hover_box">
										<select   class="select2"  id="carNumberSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber()'>x</div>
									</div>
								</div>
								
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">问题来源</span>
                                    <select name="" class="top_module_select" [(ngModel)]="tableParam.source">
                                        <option value="">全部</option>
                                        <option value="1">客户投诉</option>
										<option value="2">平台发现</option>
                                    </select>
                                </div>
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">审核状态</span>
                                    <select name="" class="top_module_select" [(ngModel)]="tableParam.status">
                                        <option value="">全部</option>
                                        <option value="0">待审核</option>
										<option value="1">审核通过</option>
										<option value="2">审核不通过</option>
                                    </select>
                                </div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								<button class="btn btn-primary" (click)="tableSearch()">查询</button>
								<button type="button" class="btn btn-primary" (click)="export_data()"  style="padding: 4px 12px;">导出</button> 
								<button type="button" class="btn btn-primary" (click)="export_Imgdata()"  style="padding: 4px 12px;">批量导出图片</button> 
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="tableParam.searchKey" (change)="tableSearch()" class="search-input" placeholder="审核人">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="tableSearch()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>车牌号码</th>
										<th>问题来源</th>
										<th>厂区</th>
										<th>处理人</th>
										<th>处理原因</th>
										<th>审核状态</th>
										<th>创建时间</th>
										<th>订单时间</th>
										<th>间隔天数</th>
										<th>硬件版本号</th>
										<th>审核人员</th>
										<th>审核时间</th>
										<th>审核意见</th>
										<th>图片</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" (dblclick)="rowSelectEvent(row)">
										<td>{{row.carNumber}}</td>
										<td>
											<span *ngIf="row.source == '1'">客户投诉</span>
											<span *ngIf="row.source == '2'">平台发现</span>
										</td>
										<td>{{row.companyName}}</td>
										<td>{{row.handleUser}}</td>
										<td>{{row.handleReason}}</td>
										<td>
											<span *ngIf="row.status == '0'"  class="orange">待审核</span>
											<span *ngIf="row.status == '1'" class="green">审核通过</span>
											<span *ngIf="row.status == '2'" class="red">审核不通过</span>
										</td>
										<td>{{row.createTime}}</td>
										 <td>{{row.orderTime}}</td> <!--订单时间 -->
										<td>{{row.intervalSky}}</td> <!--间隔天数 -->
										<td>{{row.hwVersion}}</td> <!--硬件版本号 -->

										<td>{{row.auditUser}}</td>
										<td>{{row.auditTime}}</td>
										<td>{{row.auditRemark}}</td>
										<td>
										    <button type="button" *ngIf="row.imageUrl" (click)="rowImg(row,ImgModal)">查看</button>
										</td>
										<td>
											<button type="button" (click)="rowImgUpload(row,imgUploadModal)">图片上传</button>
											<button type="button" (click)="editRow(row,GPSExamineModal)">编辑</button>
											<button type="button" *ngIf="row.status == '0'" (click)="rowSelectEvent(row)">审核</button>
											<button type="button" (click)="deleteRow(row)">删除</button>
											<button type="button" *ngIf="row.orderCode" (click)="JumpOrder(row)">跳转订单</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--审核  弹窗-->
		<div id="deviceDetailModal" >
			<div class="modal-dialog modal-lg" style="width: 1400px;margin: 0;">
					<div class="modal-content">
						<div class="modal-header" id="headDrag">
							<button type="button" class="close" (click)="closedeviceDetailModal()" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
							<h4 class="modal-title">审核详情</h4>
						</div>
						<div class="modal-body">
							<div class="row form-horizontal">
								<div class="examineTop">
									<div class="col-sm-8">
										<div class="item-box">
											<span class="item-key">基本信息:</span>
											<span class="item-value">{{deviceBaseInfo.carNumber}}</span>
											<span class="item-value stand_out">{{deviceBaseInfo.userTypeName}}</span>
											<span class="item-value">{{deviceBaseInfo.userNameForCreate}}</span>
											<span class="item-value">{{deviceBaseInfo.inputDate}}</span>
											<span class="item-value stand_out">{{deviceBaseInfo.companyName}}</span>
											<span class="item-value table_scroll" [attr.title]="deviceBaseInfo.sensorChannel">
												<span  class="channel-style bg-green" [ngClass]="{'bg-normal':!item.flag}" *ngFor="let item of deviceBaseInfo.sensorChannelT">{{item.value}}</span>
												<span *ngIf="deviceBaseInfo.sensorChannel.length == 0">--</span>
											</span>
											<span class="item-value" [attr.title]="">
												<sa-sensor-type [sensorTypeId]="deviceBaseInfo.sensorType" type='2'></sa-sensor-type>
											</span>
											<span class="item-value">ID:</span><span class="item-value">{{deviceBaseInfo.deviceId}}</span>
											<span class="item-value" *ngIf="deviceBaseInfo.phone">司机电话:</span><span class="item-value">{{deviceBaseInfo.phone}}</span>
										</div>
										
										<div class="item-box" *ngIf="deviceBaseInfo.upgradeInfo || deviceBaseInfo.logForCoef">
											<span class="item-key">操作信息:</span>
											<span class="item-value">{{deviceBaseInfo.upgradeInfo.userName}}</span>
											<span class="item-value">{{deviceBaseInfo.upgradeInfo.createTime}}</span>
											<span *ngIf="deviceBaseInfo.upgradeInfo.version">升级</span>
											<span class="item-value stand_out">{{deviceBaseInfo.upgradeInfo.version}}</span>
											
											<span class="item-value">{{deviceBaseInfo.logForCoef.userName}}</span>
											<span class="item-value">{{deviceBaseInfo.logForCoef.createTime}}</span>
											<span *ngIf="deviceBaseInfo.coef">设置</span>
											<span class="item-value" [attr.title]="deviceBaseInfo.coef">
												<span *ngIf='deviceBaseInfo.coefT.length >0'>
													<span>[</span><span *ngFor="let lis of deviceBaseInfo.coefT;let i = index;">
														<span>CH{{lis.index}}:</span><span>{{lis.value}}<span *ngIf="i < deviceBaseInfo.coefT.length-1">,</span></span>
													</span><span>]</span>
												</span>
												<span *ngIf='deviceBaseInfo.coefT.length == 0'>--</span>
											</span>
										</div>
										
										<div class="item-box">
											<span class="item-key">状态信息:</span>
											<span class="item-value" [attr.title]="">
												<span class="red" *ngIf="versionMessage.runStatus=='0'">
													离线<span *ngIf="versionMessage.alarmType">{{versionMessage.alarmType}}</span>
												</span>
												<span class="green" *ngIf="versionMessage.runStatus!=='0'">在线</span><span class="red" *ngIf="versionMessage.isShowGPS">[GPS更新异常]</span>
											</span>
											<span class="item-value">载重更新: </span><span class="item-value" [attr.title]="">{{versionMessage.carUploadDate}}</span>
											<span class="item-value">GPS更新: </span><span class="item-value" [attr.title]="">{{versionMessage.gpsUploadDate}}</span>
										    <span class="item-value bold" [ngClass]="{'red':deviceBaseInfo.isPushText == '限制进厂','green':deviceBaseInfo.isPushText == '不限制进厂'}" >{{deviceBaseInfo.isPushText}}</span>
										</div>
										<div class="item-box" *ngIf='deviceBaseInfo.haveRepaired'>
											<span class="item-key">维修信息:</span>
											<span class="item-value stand_out">{{deviceBaseInfo.haveRepaired.repairedUserName}}</span>
											<span class="item-value stand_out">{{deviceBaseInfo.haveRepaired.repairedTime}}</span>
											<span class="item-value stand_out" [attr.title]="deviceBaseInfo.haveRepaired.repairSubdivideList">
												<span *ngIf='deviceBaseInfo.haveRepaired.repairSubdivideList && deviceBaseInfo.haveRepaired.repairSubdivideList.length >0'>
													<span *ngFor="let lis of deviceBaseInfo.haveRepaired.repairSubdivideList">
														<span>{{lis}}</span>
													</span>
												</span>
												<span *ngIf='!deviceBaseInfo.haveRepaired'>--</span>
											</span>
										</div>
										<div class="item-box" *ngIf="renewalInfo.renewalDueTime&&renewalInfo.isSyncRenewal"> 
											<span class="item-key">续费信息:</span>
											<span class="item-value stand_out" [ngClass]="{'isDieLine':renewalInfo.isOverDate=='已到期','noDieLine':renewalInfo.isOverDate!='已到期'}">{{renewalInfo.isOverDate}}</span>
											<span class="item-value">到期时间:</span>
											<span class="item-value">{{renewalInfo.renewalDueTime}}</span>
											<button style="padding: 2px 8px!important;font-size: 12px;" class="btn btn-primary" type="button" (click)="goRenewal()">跳转续费页面</button>
										</div>
										<div class="item-box"> 
                                            <span class="item-key">处理原因:</span>
                                            <span class="item-value">{{selectedRow.handleReason}}</span>
                                        </div>
                                        <div class="item-box"> 
                                            <span class="item-key">指定开始时间:</span>
                                            <div class="s_hover_box">
                                                <input type="text" id="selfStartTime" class="form-control picker" [ngClass]="{endueTime:selefTimeActiveFlag == 'selfStartTime'}" (click)="selefTimeActive('selfStartTime')" autocomplete="off" style="width: 180px;display: inline-block;height: 28px;" placeholder="请选择"/>
                                                <div class="s_del_icon" (click)='delSelfStartTime()'>x</div>
                                            </div>
                                            <span class="item-key">指定结束时间:</span>
                                            <div class="s_hover_box">
                                                <input type="text" id="selfEndTime" class="form-control picker" [ngClass]="{endueTime:selefTimeActiveFlag == 'selfEndTime'}" (click)="selefTimeActive('selfEndTime')" autocomplete="off" style="width: 180px;display: inline-block;height: 28px;" placeholder="请选择"/>
                                                <div class="s_del_icon" (click)='delSelfEndTime()'>x</div>
                                            </div>
                                            <button type="button" class="btn btn-primary" (click)="drawMap()">绘图</button>
                                        </div>
									</div>
									<div class="col-sm-4" *ngIf="status == '0'">
										<p>审核意见：</p>
										<textarea class="col-sm-8" rows="5" cols="30" [(ngModel)]="auditRemark" placeholder="请输入审核意见" style="padding: 10px;"></textarea>
										<div class="col-sm-4">
											<button type="button" class="btn btn-primary" (click)="submitExamine(true)">通过</button>
											<button type="button" class="btn btn-danger" (click)="submitExamine(false)" style="margin-top: 20px;">不通过</button>
										</div>
									</div>
								</div>
								<div  class="examineMain">
									<div class="col-sm-6">
										<p style="font-size: 16px;color: darkgoldenrod;margin-bottom: 10px;padding-left: 10px;">处理前数据</p>
										<div class="col-sm-12">
											<sa-chart-bmap myChartId="chartBmap" [height]='325' [offDatas]='true' [isShowChartTop]="false" [inputParams]='drawRowData' [isShowModify]="false" [isBaiduMap]='true' [isOpenMap]="true" (outerSend)="runParent1($event)" ></sa-chart-bmap>
										</div>
										<div class="col-sm-12">
											<div>
												<sa-bmap-chart baiduMapId="baiduMap1" [trackParams]='drawTrackArr1' [repaiTimeList]="" [isTrackCheck]="false" [height]="300" deviceId="deviceId"></sa-bmap-chart>
											</div>
										</div>
									</div>
									<div class="col-sm-6">
										<p style="font-size: 16px;color: #ff00ff;margin-bottom: 10px;padding-left: 10px;">处理后数据</p>
										<div class="col-sm-12">
											<sa-chart-bmap myChartId="chartBmap2" [height]='325' [offDatas]='true' [isShowChartTop]="false" [inputParams]='drawRowData2' [isShowModify]="true" [isBaiduMap]='true' [isOpenMap]="true" (outerSend)="runParent2($event)"></sa-chart-bmap>
										</div>
										<div class="col-sm-12">
											<sa-bmap-chart baiduMapId="baiduMap2" [trackParams]='drawTrackArr2' [repaiTimeList]="repaiTimeList2" [isTrackCheck]="true" [height]="300" deviceId="deviceId"></sa-bmap-chart>
										</div>
									</div>
								</div>
								<div  class="examineBottom">
									<div class="col-sm-6" *ngFor="let item of examineDataList;let index = index" style="margin-bottom: 10px;">
										<div class="examineBottom-Table col-sm-11" >
											<div class="examine-table">记录{{index+1}}</div>
											<div class="examine-table">
												<div style="margin-top: 20px;">
													<p>处理人：</p>
													<p>{{item.userName}}</p>
												</div>
											</div>
											<div class="examine-table">
												<div style="margin-top: 20px;">
													<p>处理时间：</p>
													<p>{{item.createTime}}</p>
												</div>
											</div>
											<div class="examine-table">
												<div>
													<p *ngFor="let list of item.contentList">{{list}}</p>
												</div>
											</div>
										</div>
										<div class="col-sm-1"></div>
									</div>
								</div>
							</div>
						</div>
					</div>
			</div>
			<div style="position: absolute;right: 1px; bottom: 1px;width: 30px;height: 24px;">
				<button class="dragBtn btn btn-primary" id='dragArrow'  title="拖拽改变弹窗宽度"> ↔ </button>
			</div>
		</div>
		<!--审核  弹窗  end-->
	</sa-widgets-grid>
	<!-- 图片上传    弹窗-->
    <div bsModal #imgUploadModal="bs-modal" id="userNamePushModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" (click)="cancelImgUpload(imgUploadModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">图片上传</h4>
                </div>
                <div class="modal-body">
                    <div class="row form-horizontal">
                        <div class="imgFileList uploadScale">
                            <div class="imgFileList-power">
                                <div class="imgFileList-multifile">
                                    <span class="control-label">图片</span>
                                    <div class="uploadlocation uploadlocation1"> 
                                        <div class="content-list">
                                            <div class="headImg" *ngFor="let item of imageInfo; let i = index">
                                                <div class="contentImg"><img class="img"  [src]="item" (click)="bigImgClick('uploadScale',item)"></div>
                                                <!-- <div class="deleteCont">
                                                    <img class="bigImg" src="assets/img/bigImg.png" (click)="bigImgClick(ImgBigModal,item)" [attr.url]="item"/> -->
                                                    <i class="deleteImg" (click)="deleteImg(i)"></i>
                                                <!-- </div> -->
                                            </div>
                                            <button type="button"  class="btn div_imgall">
                                                <div class="div_shuline"></div>
                                                <div class="div_hengline"></div>
                                                <input type="file" class="up" title=" " placeholder=" "  multiple (change)="multifileChange($event.target.files)"/>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" (click)="cancelImgUpload(imgUploadModal)">取消</button>
                    <button type="button" class="btn btn-primary" (click)="submitImgUpload(imgUploadModal)">上传</button>
                </div>
            </div>
        </div>
    </div>
    <!--图片上传  end-->
    
    <!-- 图片放大查看   弹窗-->
    <section bsModal #ImgBigModal="bs-modal" class="modal fade imgView" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
        <!-- <div class="closeImg" (click)="CloseBigImg(ImgBigModal)"></div> -->
        <div class="modal-content modal-imgContent" (click)="CloseBigImg(ImgBigModal)" >
            <img [src]="bigImg" />
        </div>
    </section>
    <!-- 图片放大查看 弹窗end-->
    
    <!-- 图片查看   弹窗-->
    <section bsModal #ImgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" aria-label="Close" (click)="cancelImg(ImgModal)"><span aria-hidden="true">&times;</span></button>     
                    <h4 class="modal-title">图片</h4>
                </div>
                <div class="modal-body" style="max-height: 520px; overflow: auto;">
                    <div class="row form-horizontal imagesInfo" *ngIf='imgUpload.imageInfo.length != 0'>
                        <div class="imagesList imagesList-sensor imgScale">
                            <div  class="imagesInfoFile">
                                <div class="imgFileList">
                                    <!--<label class="imgTitle">图片</label>-->
                                    <div class="imgContList">
                                        <div class="imgCont" *ngFor="let row of imgUpload.imageInfo" (click)="bigImgClick('imgScale',row)">
                                            <img class="imgSrc" [src]="row"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
	<!-- 图片查看 弹窗end-->
	<!--提交GPS审核  弹窗-->
	<section bsModal #GPSExamineModal="bs-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" (click)="closeGPSExamineModal(GPSExamineModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
						<h4 class="modal-title">提交GPS审核</h4>
					</div>
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="form-group clearfix">
								<label class="control-label col-sm-2 no-padding-right">问题来源</label>
								<div class="col-sm-9">
									<div class="clearfix">
										<select class="form-control" name="source" [(ngModel)]="Examine.source" style="width: 100%" (change)="sourceChange($event.target.value)">
											<option *ngFor="let item of sourceList" [value]="item.value">{{item.text}}</option>
										</select>
									</div>
								</div>
							</div>
							<div class="form-group clearfix">
								<label class="control-label col-sm-2 no-padding-right">处理原因</label>
								<div class="col-sm-9">
									<div class="clearfix">
										<select class="form-control" name="reason" [(ngModel)]="Examine.reason" style="width: 100%" (change)="reasonChange($event.target.value)">
											<option *ngFor="let list of GPSModuleList" [value]="list.text">{{list.text}}</option>
										</select>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" (click)="closeGPSExamineModal(GPSExamineModal)">取消</button>
						<button type="button" class="btn btn-primary" (click)="submitGPSExamineModal(GPSExamineModal)">提交</button>
					</div>
				</div>
			</div>
	</section>
	<!--提交GPS审核  弹窗  end-->
</div>